/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package jpa.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author julio
 */
@Embeddable
public class ShapesPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 45)
    @Column(name = "shape_id")
    private String shapeId;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 45)
    @Column(name = "shape_pt_lat")
    private String shapePtLat;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 45)
    @Column(name = "shape_pt_lon")
    private String shapePtLon;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 45)
    @Column(name = "shape_pt_sequence")
    private String shapePtSequence;

    public ShapesPK() {
    }

    public ShapesPK(String shapeId, String shapePtLat, String shapePtLon, String shapePtSequence) {
        this.shapeId = shapeId;
        this.shapePtLat = shapePtLat;
        this.shapePtLon = shapePtLon;
        this.shapePtSequence = shapePtSequence;
    }

    public String getShapeId() {
        return shapeId;
    }

    public void setShapeId(String shapeId) {
        this.shapeId = shapeId;
    }

    public String getShapePtLat() {
        return shapePtLat;
    }

    public void setShapePtLat(String shapePtLat) {
        this.shapePtLat = shapePtLat;
    }

    public String getShapePtLon() {
        return shapePtLon;
    }

    public void setShapePtLon(String shapePtLon) {
        this.shapePtLon = shapePtLon;
    }

    public String getShapePtSequence() {
        return shapePtSequence;
    }

    public void setShapePtSequence(String shapePtSequence) {
        this.shapePtSequence = shapePtSequence;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (shapeId != null ? shapeId.hashCode() : 0);
        hash += (shapePtLat != null ? shapePtLat.hashCode() : 0);
        hash += (shapePtLon != null ? shapePtLon.hashCode() : 0);
        hash += (shapePtSequence != null ? shapePtSequence.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ShapesPK)) {
            return false;
        }
        ShapesPK other = (ShapesPK) object;
        if ((this.shapeId == null && other.shapeId != null) || (this.shapeId != null && !this.shapeId.equals(other.shapeId))) {
            return false;
        }
        if ((this.shapePtLat == null && other.shapePtLat != null) || (this.shapePtLat != null && !this.shapePtLat.equals(other.shapePtLat))) {
            return false;
        }
        if ((this.shapePtLon == null && other.shapePtLon != null) || (this.shapePtLon != null && !this.shapePtLon.equals(other.shapePtLon))) {
            return false;
        }
        if ((this.shapePtSequence == null && other.shapePtSequence != null) || (this.shapePtSequence != null && !this.shapePtSequence.equals(other.shapePtSequence))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "jpa.entities.ShapesPK[ shapeId=" + shapeId + ", shapePtLat=" + shapePtLat + ", shapePtLon=" + shapePtLon + ", shapePtSequence=" + shapePtSequence + " ]";
    }
    
}
